<%@ include file="/html/portlet/ext/registration/init.jsp" %>


<% 
	Student student = (Student)request.getAttribute("student");
	
	System.out.println("student jsp >>>"+student.getCity());
	
	SimpleDateFormat sdf = new SimpleDateFormat("MMM,yyyy");
	
	Long countryId = Long.parseLong(student.getCountry());
   	Long regionId = Long.parseLong(student.getState());
   	Long cityId = Long.parseLong(student.getCity());
   	
   	PortletURL url1 = renderResponse.createActionURL();
		url1.setWindowState(WindowState.NORMAL);
		url1.setParameter("struts_action", "/ext/registration/addRegistration");
		url1.setParameter("cmd", "pendingStudent");
	
	PortletURL url2 = renderResponse.createActionURL();
		url2.setWindowState(WindowState.NORMAL);
		url2.setParameter("struts_action", "/ext/registration/addRegistration");
		url2.setParameter("cmd", "rejectStudent");
   	
%>

<script type="text/javascript">

function submit1(url) {
		var frm = document.<portlet:namespace/>fm;
		submitForm(frm,url);
	}
	
</script>

<form name="<portlet:namespace/>fm"  method="POST">
<table width='100%' class='portlet-box' align='center' cellspacing="0" cellpadding="2" style='border:1px solid LightSteelBlue;'>
	<tr class='results-header'>
		<td class='portlet-font' colspan='3' style='font-weight:bold;height:25px' nowrap>
		<liferay-ui:message key="student-details" />
		</td>
	</tr>

	<tr class = "portlet-section-body results-row alt">
		<td width='40%'> <liferay-ui:message key="roll-no" /></td>
		<td width='60%'> <%= student.getRollNo() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td> <liferay-ui:message key="first-name" /></td>
		<td> <%= student.getFirstName() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="middle-name" /></td>
		<td> <%= student.getMiddleName() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="last-name" /></td>
		<td> <%= student.getLastName() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="standard" /></td>
		<td> <%= student.getStandard() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="gender" /></td>
		<td> <%= !student.getGender() ? "Femail" : "Male" %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="birthday" /></td>
		<td> <%= sdf.format(student.getBirthDay()) %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="street-address3" /></td>
		<td> <%= student.getStreet1() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="street-address2" /></td>
		<td> <%= student.getStreet2() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="street-address3" /></td>
		<td> <%= student.getStreet3() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="country" /></td>
		<td> <%= CityLocalServiceUtil.countryName(countryId)  %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="state" /></td>
		<td> <%= CityLocalServiceUtil.stateName(regionId) %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="city" /></td>
		<td> <%= CityLocalServiceUtil.cityName(cityId) %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row">
		<td><liferay-ui:message key="pin-code" /></td>
		<td> <%= student.getPinCode() %> </td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="contact-no" /></td>
		<td> <%= student.getContactNo() %> </td>
	</tr>
	
	<tr class='results-header'>
		<td><liferay-ui:message key="login-details" /></td>
		<td></td>
	</tr>
	
	<tr class = "portlet-section-body results-row alt">
		<td><liferay-ui:message key="user-name" /></td>
		<td> <%= student.getLoginId() %> </td>
	</tr>
</table>
<br>
<table align='center'>
	<tr class="portlet-form-button">
		<td>
			<input type="hidden" name="studentId" value="<%= student.getStudentId() %>"/>
	    	<input type="submit" value="<liferay-ui:message key="pending" />" onClick="submit1('<%=url1.toString()%>');" />
	    	<input type="submit" value="<liferay-ui:message key="reject" />" onClick="submit1('<%=url2.toString()%>');" />
	    	<input type="button"  value='<liferay-ui:message key="cancel" />' onClick='history.go(-1)'>
		</td>
	</tr>
</table>
</form>